//
//  LoginViewController.m
//  Wedding fantastic
//
//  Created by ZLM on 15/6/30.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "LoginViewController.h"

@interface LoginViewController ()

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.backgroundColor = [UIColor clearColor];
    button.frame = CGRectMake(10*kWidth/375, 70*kHeight/667, 100*kWidth/375, 50*kHeight/667);
    [button setTitle:@"请返回" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [self.view addSubview:button];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.idLabel = [[UILabel alloc]initWithFrame:CGRectMake(40*kWidth/375, 150*kHeight/667, 80*kWidth/375, 30*kHeight/667)];
    self.idLabel.text = @"用户名:";
    self.idLabel.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.idLabel];
    self.userId = [[UITextField alloc]initWithFrame:CGRectMake(150*kWidth/375, 150*kHeight/667, 200*kWidth/375, 30*kHeight/667)];
    self.userId.placeholder = @"用户名";
    self.userId.borderStyle = UITextBorderStyleRoundedRect;
    [self.view addSubview:self.userId];
    
    self.pwdLabel = [[UILabel alloc]initWithFrame:CGRectMake(40*kWidth/375, 200*kHeight/667, 80*kWidth/375, 30*kHeight/667)];
    self.pwdLabel.text = @"密  码:";
    self.pwdLabel.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.pwdLabel];
    self.uerPwd = [[UITextField alloc]initWithFrame:CGRectMake(150*kWidth/375, 200*kHeight/667, 200*kWidth/375, 30*kHeight/667)];
    self.uerPwd.borderStyle = UITextBorderStyleRoundedRect;
    self.uerPwd.placeholder = @"密码";
    [self.view addSubview:self.uerPwd];
  
    self.loginButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.loginButton.frame = CGRectMake(40*kWidth/375, 260*kHeight/667, 80*kWidth/375, 50*kHeight/667);
    [self.loginButton setTitle:@"确定" forState:UIControlStateNormal];
    [self.loginButton setTitle:@"确定" forState:UIControlStateHighlighted];
    self.loginButton.backgroundColor = [UIColor clearColor];
    [self.loginButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [self.view addSubview:self.loginButton];
    
    self.cancelButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [self.view addSubview:self.cancelButton];
    self.cancelButton.frame = CGRectMake(240*kWidth/375, 260*kHeight/667, 80*kWidth/375, 50*kHeight/667);
    [self.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
    [self.cancelButton setTitle:@"取消" forState:UIControlStateHighlighted];
    self.cancelButton.backgroundColor = [UIColor clearColor];
    [self.cancelButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    
    self.userId.delegate = self;
    self.uerPwd.delegate = self;
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}
-(void)buttonAction:(UIButton *)button{
   [self dismissViewControllerAnimated:YES completion:^{
       
       NSLog(@"模态消失");
   }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
